/*
 * @Author: Drc
 * @Date: 2020-12-14 16:35:06
 * @LastEditTime: 2021-10-12 09:58:30
 * @LastEditors: Drc
 */
/**
 * @format
 */

import {AppRegistry, LogBox} from 'react-native'
import Index from './src/js/index'
import {name as appName} from './app.json'
import {gestureHandlerRootHOC} from 'react-native-gesture-handler'
import CodePush from 'react-native-code-push'

LogBox.ignoreLogs([
  'VirtualizedList',
  'Error evaluating injectedJavaScript',
  'source.uri should not be an empty string',
  'Possible Unhandled Promise Rejection',
  'Warning: Each child in a list should have a unique "key" prop.',
  'Warning: Failed prop type: Invalid prop `source` supplied to `Image`.',
  'Warning: Failed prop type: Invalid props.style key `color` supplied to `Toast`.',
  'Warning: Cannot update a component from inside the function body of a different component.',
  'Warning: Failed child context type: Invalid child context `virtualizedCell.cellKey` of type `number` supplied to `CellRenderer`, expected `string`.',
  'Non-serializable values were found in the navigation state',
])

LogBox.ignoreAllLogs(true)

const codePushOptions = {
  checkFrequency: __DEV__ ? CodePush.CheckFrequency.MANUAL : CodePush.CheckFrequency.ON_APP_RESUME,
}

AppRegistry.registerComponent(appName, () => CodePush(codePushOptions)(gestureHandlerRootHOC(Index)))
